﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Uniriotec.DC.CoordDist.Distribuida
{
    public enum MessageVerb 
    { 
        Req = 1,
        Ack = 2,
        Nak = 3
    }
    
    public class Message
    {
        #region Private fields

        private int time;
        private int procId;
        private MessageVerb verb;

        #endregion

        #region Properties

        public int ProcId
        {
            get { return procId; }
            set { procId = value; }
        }

        public int Time
        {
            get { return time; }
            set { time = value; }
        }

        public MessageVerb Verb
        {
            get { return verb; }
            set { verb = value; }
        }

        #endregion

        #region Constructors

        public Message(int procId, int time, MessageVerb verb)
        {
            this.procId = procId;
            this.time = time;
            this.verb = verb;
        }

        #endregion

        #region Overriden Methods

        public override string ToString()
        {
            return procId + "," + time + "," + (int)verb;
        }

        #endregion
    }
}
